﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace DataModel.Commands
{
    public class AlwaysOnCommand:ICommand
    {
        public AlwaysOnCommand(Action Action)
        {
            action = (o) => Action();
        }
        public AlwaysOnCommand(Action<object> Action)
        {
            action = Action;
        }

        Action<object> action;

        #region ICommand Members

        public bool CanExecute(object parameter)
        {
            return true;
        }

#pragma warning disable 0067//ignore the warning about this event never being used.
        public event EventHandler CanExecuteChanged;
#pragma warning restore 0067

        public void Execute(object parameter)
        {
            action(parameter);
        }

        #endregion
    }
}
